HA$PBExportHeader$w_help_main.srw
forward
global type w_help_main from window
end type
type cb_cancelar from commandbutton within w_help_main
end type
type cb_aceptar from commandbutton within w_help_main
end type
type dw_1 from datawindow within w_help_main
end type
end forward

global type w_help_main from window
integer width = 2930
integer height = 1028
boolean titlebar = true
string title = "Parametros"
boolean controlmenu = true
windowtype windowtype = response!
long backcolor = 67108864
string icon = "AppIcon!"
boolean center = true
cb_cancelar cb_cancelar
cb_aceptar cb_aceptar
dw_1 dw_1
end type
global w_help_main w_help_main

type variables
s_param_report  istruc_param_report_arg
s_parm istr_parm
integer ii_arg
datastore ids_report
datawindow idw
datawindowchild dwc
boolean ib_Indicador_Cierre
end variables

forward prototypes
public subroutine of_retrieve (any param1)
public subroutine of_retrieve (any param1, any param2)
public subroutine of_retrieve (any param1, any param2, any param3)
public subroutine wf_ejecutar_reporte ()
public subroutine of_color (long al_color)
end prototypes

public subroutine of_retrieve (any param1);
end subroutine

public subroutine of_retrieve (any param1, any param2);/*
*/

idw.retrieve(param1,param2 )

commit;
end subroutine

public subroutine of_retrieve (any param1, any param2, any param3);/*
*/

idw.retrieve(param1,param2 ,param3 )

commit;
end subroutine

public subroutine wf_ejecutar_reporte ();istr_parm.dw_parm[1].setTransobject(SQLCA)
end subroutine

public subroutine of_color (long al_color);integer li_columna,li_index
string  ls_columna,ls_Required,ls_style

li_columna = integer(dw_1.Object.DataWindow.Column.Count)

for li_index=1 to li_columna
	
	  ls_Columna="#" + string(li_index) + ".name"
	 //Nombre de la Columna
	 Ls_Columna=dw_1.Describe(Ls_Columna)
	 //Estilo de Edicion
	 ls_Style=Ls_Columna + ".edit.style"
	 Ls_Style=lower(dw_1.Describe(Ls_Style))
	 
	 CHOOSE CASE Ls_Style
		CASE 'dddw'
			Ls_Required=lower(dw_1.Describe(Ls_Columna + ".dddw.Required"))
		CASE 'ddlb'
			Ls_Required=lower(dw_1.Describe(Ls_Columna + ".ddlb.Required")			)
		CASE 'edit'
			Ls_Required=lower(dw_1.Describe(Ls_Columna + ".edit.Required"))
		CASE 'editmask'
			Ls_Required=lower(dw_1.Describe(Ls_Columna + ".editmask.Required"))
		CASE ELSE
			Continue
	 END CHOOSE
	 
	 If Ls_Required='yes' Then
		Ls_Columna=Ls_Columna + '.Background.Color=' + string(al_color)
		dw_1.Modify(Ls_Columna)
	 End If
	 
next
end subroutine

on w_help_main.create
this.cb_cancelar=create cb_cancelar
this.cb_aceptar=create cb_aceptar
this.dw_1=create dw_1
this.Control[]={this.cb_cancelar,&
this.cb_aceptar,&
this.dw_1}
end on

on w_help_main.destroy
destroy(this.cb_cancelar)
destroy(this.cb_aceptar)
destroy(this.dw_1)
end on

event open;of_color(rgb(27,208,228))
istr_parm=message.powerobjectparm

istr_parm.char_parm[1]='0'

dw_1.settransobject(SQLCA)



end event

event close;if not ib_Indicador_Cierre then
	cb_cancelar.event clicked()
end if
end event

type cb_cancelar from commandbutton within w_help_main
integer x = 471
integer y = 804
integer width = 402
integer height = 112
integer taborder = 30
integer textsize = -8
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "&Cancelar"
end type

event clicked;ib_Indicador_Cierre = True
closewithreturn(parent,istr_parm)

end event

type cb_aceptar from commandbutton within w_help_main
integer x = 37
integer y = 804
integer width = 402
integer height = 112
integer taborder = 20
integer textsize = -8
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "&Aceptar"
end type

event clicked;//parent.function wf_ejecutar_reporte()
//cb_cancelar.triggerevent( clicked!)
if dw_1.accepttext( ) =  - 1  then return 0
If f_findrequired(dw_1) = -1 Then Return 0

if dw_1.event ue_validar() = - 1  then return  0

istr_parm.char_parm[1]='1'
cb_cancelar.event post clicked()

//dw_1.AcceptText()
//
//istr_parm.long_parm[1]=dw_1.GetNextModified(0,primary!)
//istr_parm.long_parm[2] = 1
//
//DO WHILE istr_parm.long_parm[1] > 0
//	IF dw_1.GetItemString(istr_parm.long_parm[1],'cb_ok') = '1' THEN
//		istr_parm.string_parm[istr_parm.long_parm[2]]=dw_1.getitemstring(istr_parm.long_parm[1],'cc_artic')
//		istr_parm.long_parm[2]++
//	ELSE
//		istr_parm.char_parm[1]='0'
//	END IF	
//	istr_parm.long_parm[1]=dw_1.GetNextModified(istr_parm.long_parm[1],primary!)
//LOOP
//
//Return
//
//
end event

type dw_1 from datawindow within w_help_main
event type integer ue_validar ( )
integer x = 23
integer y = 20
integer width = 2880
integer height = 752
integer taborder = 10
string title = "none"
string dataobject = "d_mplantillaitem_tabular"
boolean livescroll = true
borderstyle borderstyle = stylelowered!
end type

